<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>广西科技厅公文督办系统</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript"
			src="datePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="myjs.js"></script>
<script language="javascript">
	function mydel() {
		if (is_cb_checked('cb_del_id')) {
			if (confirm('确实要删除选中的记录吗？')) {
				document.getElementById('action').value = 'del';
				document.forms[0].submit();
			}
		} else {
			alert('请选择要删除的记录');
		}
	}

	function mygetfile() {
		document.getElementById('action').value = 'get';
		document.forms[0].submit();

	}

	function myendfile() {
		
		document.getElementById('action').value = 'end';
		document.forms[0].submit();
	}
	
	function mysearch(){
	   document.getElementById('action').value = 'search';
		document.forms[0].submit();
	}
	
	function  init(){
		var init_action = '${init_action}';//初始化动作类型
		var search_type = '${type}';
		if(init_action == 'return_search'){
		  var ras = document.getElementById('search_type');
		for(i=0;i<ras.options.length;i++){
		   if(search_type == ras.options[i].value){
		       ras.options[i].selected = true;
			   break;   

		   }
		}
		}
		
		
		
	}
</script>
<!--
<object width="32" height="32" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="LEFT: 0px; WIDTH: 1001px; HEIGHT:900px; POSITION: absolute; TOP: 100px;Right:1px">
  <param value="img/fish.swf" name="movie">
  <param value="high" name="quality">
  <param value="transparent" name="wmode">
  <embed wmode="transparent" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="img/fish.swf" style="LEFT: 0px; WIDTH: 1001px; HEIGHT:900px; POSITION: absolute; TOP: 100px;Right:1px">
</object>
-->
</head>

<body onload="init()" >
<form method="post" action="MyController">
  <input id="calendar_date" name="calendar_date" type="hidden"
				value="${calendar_date}" />
  <input id="action" name="action" type="hidden" value="" />
  <input id="uid" name="uid" type="hidden" value="" />
  <div class="div_body">
    <div id="getfile" style="display: none"> 签&nbsp;收&nbsp;人：
      <input type="text" id="get_guy" name="get_guy"
						style="margin: 0 2px;" />
      <br />
      <br />
      签收时间：
      <input name="get_date" id="get_date" type="text"
						onFocus="WdatePicker({isShowClear:false,readOnly:true})"
						class="Wdate" />
      <br />
      <br />
      <div style="margin: 0 auto; width: 150px">
        <input type="button" value="提交" onclick="javascript:mygetfile();" />
        &nbsp;
        <input type="button" value="返回"
							onclick="javascript:document.getElementById('getfile').style.display='none';" />
      </div>
    </div>
    <div id="endfile" style="display: none"> 是否办结： 是
      <input type="radio" name="is_end" value="1" />
      &nbsp;否
      <input type="radio" name="is_end" value="0" />
      <br />
      <br />
      办结时间：
      <input name="end_date" id="end_date" type="text"
						onFocus="WdatePicker({isShowClear:false,readOnly:true})"
						class="Wdate" />
      <br />
      <br />
      <div style="margin: 0 auto; width: 150px">
        <input type="button" value="提交" onclick="javascript:myendfile();" />
        &nbsp;
        <input type="button" value="返回"
							onclick="javascript:document.getElementById('endfile').style.display='none';" />
      </div>
    </div>
    <div>
      <h3> &nbsp;广西科技厅公文督办系统 <sup> 测试版 </sup> </h3>
      <ul>
        <li  class="title_tab"> <a href="#">送文签收表</a> </li>
        <li class="title_tab"> <a href="#">送文登记表</a> </li>
        <li class="title_tab"> <a href="MyController?action=showDubanTable" target="_blank">公文督办表</a> </li>
      </ul>
    </div>
    <div style="clear:both;">
      <div>
        <div style="margin:2px;"> 请选择日期范围：
          <input id="d4311" name="start_from_date" class="Wdate"
								type="text"
								onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'d4312\')||\'2020-10-01\'}'})" value="${start_from_date}" />
          到
          <input id="d4312" name="end_from_date" class="Wdate" type="text"
								onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d4311\')}',maxDate:'2020-10-01'})" value="${end_from_date}" />
        </div>
        请选择查询类型：
        <select id="search_type" name="search_type" id="search_type">
        <option value="file_title" selected="selected"> 文件标题 </option>
        <option value="from_dep"> 来文单位 </option>
        <option value="file_num"> 文号 </option>
        </select>
        请输入查询内容：
        <input name="search_text" id="search_text" type="text" value="${keyword}" />
        <input name="search_btn" id="search_btn" type="button" value="查询" onclick="javascript:mysearch()"/>
        <a href="qs_insert.jsp">新增</a> &nbsp;<a href="#" onclick="javascript:mydel()">删除</a> &nbsp;<a href="MyController?action=printQsTable&calendar_date=${calendar_date}" target="_blank">打印</a> </div>
      <div class="div_left">
        <table width="100%" border="1">
          <tr>
            <th scope="col"> 选择 </th>
            <th scope="col"> 日期 </th>
            <th scope="col"> 来文单位 </th>
            <th scope="col"> 文号 </th>
            <th scope="col"> 标题 </th>
            <th scope="col"> 阅示领导 </th>
            <th scope="col"> 处室 </th>
            <th scope="col"> 签收人 </th>
            <th scope="col"> 签收时间 </th>
            <th scope="col"> 备注 </th>
            <th scope="col"> 操作 </th>
          </tr>
          <c:forEach items="${resultQsTable }" var="table">
              <tr 
            
            <c:if test ="${table.mark=='督办'}"> class="font_red" </c:if>
            <c:if test="${table.mark=='会议'}"> class = "font_blue" </c:if>
            >
            
              <td><input name="cb_del_id" type="checkbox" value="${table.uid}" /></td>
              <td> ${table.from_date } </td>
              <td> ${table.from_dep } </td>
              <td> ${table.file_num } </td>
              <td> ${table.file_title }&nbsp;
                <c:if test="${table.mark=='督办'}"> 回复时间：${table.rep_date}</c:if>
                会议<c:if test="${table.mark=='会议'}">时间：${table.meeting_date}</c:if></td>
              <td> ${table.file_leader } </td>
              <td> ${table.file_dep } </td>
              <td> ${table.get_guy } </td>
              <td> ${table.get_date } </td>
              <td> ${table.mark } <br />
                ${table.remark} </td>
              <td><a href="MyController?action=updating&uid=${table.uid}">编辑</a>&nbsp; <a href="#"
											onclick="javascript:document.getElementById('getfile').style.display='block';document.getElementById('uid').value='${table.uid}';doucument.getElementById('calendar_date').value='${table.from_date}';">签收</a>&nbsp;
                <c:if test="${table.mark=='督办'}"> <a href="#"
												onclick="javascript:document.getElementById('endfile').style.display='block';document.getElementById('uid').value='${table.uid}';doucument.getElementById('calendar_date').value='${table.from_date}';">办结</a> </c:if></td>
            </tr>
          </c:forEach>
        </table>
      </div>
      <div id="div_right"></div>
      <script>
	WdatePicker({
		eCont : 'div_right',
		onpicked : function(dp) {
			document.getElementById("calendar_date").value = dp.cal
					.getDateStr();
			document.getElementById("action").value = "queryByCalendar";
			document.forms[0].submit();
		}
	});
</script> 
    </div>
    <div></div>
  </div>
</form>
</body>
</html>